#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
int T,n,a[N][2];
int main(){
    freopen("color.in","r",stdin);
    freopen("color.out","w",stdout);
    scanf("%d",&T);
    for(;T--;){
        scanf("%d",&n);
        for(int i=1;i<=n;i++){
            int x;
            scanf("%d",&x);
            a[i][0]=x;
            for(int j=i-1;j;j--)
                if(a[i][0]==a[j][0]){a[i][0]=j;break;}
        }
    }
    return 0;
}
